package base_java;

public class Generic<T,K> {
    private T user;
    private K city;

    public T getUser() {
        return user;
    }

    public void setUser(T user) {
        this.user = user;
    }

    public K getCity() {
        return city;
    }

    public void setCity(K city) {
        this.city = city;
    }

    @Override
    public String toString() {
        return "Generic{" +
                "user=" + user +
                ", city=" + city +
                '}';
    }
    public void f1(){
        System.out.println(user);
        System.out.println(city);
    }
}
class User{
    private String name;
    private Integer age;

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
class City{
    private String city;

    @Override
    public String toString() {
        return "City{" +
                "city='" + city + '\'' +
                '}';
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }
}
class Main5{
    public static void main(String[] args) {
        User user =new User();
        user.setAge(12);
        user.setName("aaaa");
        Generic<User,City> generic=new Generic();
        generic.setUser(user);
        generic.f1();
    }
}